package org.example;

import org.example.dao.UserDao;
import org.example.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args ) {
        System.out.println( "Hello World!" );
        //创建IOC容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("springConfig.xml");
//        //获取bean
//        UserDao userDao = ctx.getBean("userDao1Impl",UserDao.class);
//        //调用方法
//        userDao.save();
        UserService userService = ctx.getBean(UserService.class);

        userService.getList();
    }
}
